CPE/EE 422/522, Laboratory Assignment 4

Keypad Interface

(Undergraduate 10% of Final Grade -- Graduate 5% of Final Grade)

 

The purpose of this laboratory project is to give each student the opportunity to develop a practical logic design using schematic capture and/or VHDL that will decode a 16 Key scanning keypad and display the hexadecimal symbol associated with each key that was pressed on two of the Altera UP 1 Educational Trainer's seven-segment LEDs.

Background

Scanning keypads (and keyboards) are designed with the idea of reducing the number of I/O lines that enter and exit the keypad. If each key on a keypad (or keyboard) acted as an individual switch the number of lines that would have to be run into the digital logic would equal the number of keys plus one (assuming a common ground is used). As the number of keys increases, a better alternative is to set up a switch matrix as shown in Figure 1. This arrangement requires that the total of number of pins, , where keys is the number of keys on the keypad (or keyboard), int is the next lowest integer value, and ceil is the next highest integer value. Thus for a 100 key keyboard a nonscanning keypad implementation would require 101 lines be brought out into the external logic, whereas a scanning keypad implementation would only require that 20 lines be used.

 

Section 3.5 (pages 109-118) of the text contain a fairly detailed description of a Scanning Keypad design that is to be implemented using a simple Programable Logic Device, PLD. Please read over this material to get a better understanding of the hardware solution to the keypad scanning process and solving the key debounce problem. Then apply this knowledge to solve the following problem.

Assignment

Students are to connect a sixteen key keypad to the Altera UP-1 Educational boards in a manner that will allow the hexadecimal value of each key that is pressed to be displayed on the two seven-segment LED's that are associated with the 10K20 device. The Altera 10K20 device should then be configured to allow the LEDs to display the binary values associated with the last two keys that were pressed. Every time a new key is pressed the hexadecimal value associated with the previous key that was pressed should be shifted over to the left most LED with the right most one always being used to display the new key that was pressed. The design should compensate for keyboard debounce.

The layout matrix for the keypads that are to be used in this lab are shown in Figure 1. Each student is to use pull-up or pull down resistors and jumper wires to connect the keypads to the jumper sockets associated with the 10K20 device on the Altera UP-1 board in the appropriate manner.

 

The hexadecimal values associated with each key of the keyboard are shown in Table 1.

 

 

Hexadecimal Symbol for each Key

Key

LED

Configuration

Key

LED

Configuration

 

 

 

0

 

 

 

8

 

 

 

1

 

 

 

9

 

 

 

2

 

 

 

A

 

 

 

3

 

 

 

B

 

 

 

4

 

 

 

C

 

 

 

5

 

 

 

D

 

 

 

6

 

 

 

*

 

 

 

7

 

 

 

#

 

Each student is to work individually and demonstrate the design to the laboratory or course instructor.

 

Due Date Thursday, July 25.